<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:a="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	template="/templates/mainTemplate.xhtml">


	<ui:define name="content">
		<f:view>
			<h:form id="registroUsuario">
				<div align="center">
					<rich:panel style="margin-top: 25px; height: 540px; width:600px;">
						<div class="register bloques">
						<div align="center"><h:graphicImage
							value="/layout/img/registro.jpg"></h:graphicImage></div>
		
						<div align="right" style="padding-right: 90px;"><h:panelGrid
							columns="3" rowClasses="registerRow" >
		
		
							<h:outputLabel value="#{messages.username}" for="regUserName"></h:outputLabel>
		
							<h:inputText id="regUserName" style="width: 100px;"
								styleClass="inputText" value="#{user.usuario}">
								<s:validate />
							</h:inputText>
							<h:message for="regUserName"></h:message>
		
							<h:outputLabel value="#{messages.password}" for="regPassword1"></h:outputLabel>
							<h:inputSecret id="regPassword1" style="width: 100px;"
								styleClass="inputText" value="#{user.password}"></h:inputSecret>
							<h:message for="regPassword1"></h:message>
		
		
							<h:outputLabel value="#{messages.password2}" for="regPassword2"></h:outputLabel>
							<h:inputSecret id="regPassword2" style="width: 100px;"
								styleClass="inputText" value="#{user.confirmacionPassword}"></h:inputSecret>
							<h:message for="regPassword2"></h:message>
		
		
							<h:outputLabel value="#{messages.name}" for="regName"></h:outputLabel>
							<h:inputText id="regName" style="width: 100px;"
								styleClass="inputText" value="#{user.nombre}"></h:inputText>
							<h:message for="regName"></h:message>
		
		
							<h:outputLabel value="#{messages.firstSurname}"
								for="regfirstSurname"></h:outputLabel>
							<h:inputText id="regfirstSurname" style="width: 100px;"
								styleClass="inputText" value="#{user.apellido1}"></h:inputText>
							<h:message for="regfirstSurname"></h:message>
		
		
							<h:outputLabel value="#{messages.secondSurname}"
								for="regsecondSurname"></h:outputLabel>
							<h:inputText id="regsecondSurname" style="width: 100px;"
								styleClass="inputText" value="#{user.apellido2}"></h:inputText>
							<h:message for="regsecondSurname"></h:message>
		
		
							<h:outputLabel value="#{messages.address}" for="regAddress"></h:outputLabel>
							<h:inputText id="regAddress" style="width: 100px;"
								styleClass="inputText" value="#{user.direccion}"></h:inputText>
							<h:message for="regAddress"></h:message>
		
		
		
							<h:outputLabel value="#{messages.province}" for="regProvincias"></h:outputLabel>
							<h:selectOneMenu id="regProvincias"
								value="#{registerUser.provinciaUsuario}" immediate="true">
								<a:support event="onchange" reRender="regMunicipiosPanel" />
								<s:selectItems value="#{provincias}" var="provinciaUsuario"
									label="#{provinciaUsuario.nombre}"
									noSelectionLabel="Seleccione provincia" />
								<s:convertEntity />
							</h:selectOneMenu>
							<h:message for="regProvincias"></h:message>
		
							<h:outputLabel value="#{messages.city}" for="regMunicipio"></h:outputLabel>
							<a:outputPanel id="regMunicipiosPanel" ajaxRendered="true">
								<h:selectOneMenu id="regMunicipio"
									value="#{registerUser.municipioUsuario}">
									<s:selectItems value="#{registerUser.findMunicipios()}"
										var="municipioUsuario" label="#{municipioUsuario.nombre}"
										noSelectionLabel="Seleccione Municipio" />
									<s:convertEntity />
								</h:selectOneMenu>
							</a:outputPanel>
							<h:message for="regMunicipio"></h:message>
		
		
		
							<h:outputLabel value="#{messages.email}" for="regEmail"></h:outputLabel>
							<h:inputText id="regEmail" style="width: 100px;"
								styleClass="inputText" value="#{user.email}"></h:inputText>
							<h:message for="regEmail" style="width:50px;"></h:message>
		
		
							<h:outputLabel value="#{messages.phone}" for="regPhone"></h:outputLabel>
							<h:inputText id="regPhone" style="width: 100px;"
								styleClass="inputText" value="#{user.telefono}"></h:inputText>
							<h:message for="regPhone" style="width:50px;"></h:message>
		
						</h:panelGrid></div>
		
						<div align="center" style="margin-top: 13px;"><h:commandButton
							id="bRegister" value="#{messages.registerButton}"
							styleClass="btn100" action="#{registerUser.register}"></h:commandButton><h:commandButton
							id="bRegCancel" value="#{messages.cancel}" styleClass="btn100"
							action="#{registerUser.cancel}"></h:commandButton></div>
						<div align="center" style="margin-top: 20px;">
						<h:messages globalOnly="true"/>
						</div>
						</div>
					</rich:panel>
				</div>
			</h:form>
		</f:view>

	</ui:define>

</ui:composition>